package com.bt.lms.ui.page.sys.style;

import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.scene.paint.CycleMethod;
import javafx.scene.paint.LinearGradient;
import javafx.scene.paint.Stop;

/**
 * 盒子样式
 */
public class BoxStyle {

    /**
     * 主题背景色
     * @param pane 盒子
     */
    public static void mainBackdrop(Pane pane){

        Color color = Color.rgb(235,235,235);
        Color toColor = Color.rgb(225,225,225);

        //可以渐变的颜色（0-1）
        Stop[] stops = new Stop[]{
                new Stop(0, color), new Stop(1, toColor)};

        //渐变颜色（0-1变化）
        LinearGradient linear = new LinearGradient(
                0, 0, 0, 1, true,
                CycleMethod.NO_CYCLE, stops);


        BackgroundFill backgroundFill = new BackgroundFill(linear, null, null);
        Background background = new Background(backgroundFill);
        pane.setBackground(background);

    }

    /**
     * 全局背景色
     * @param pane 全局盒子
     */
    public static void overallSituation(Pane pane){
//        Color rgb = Color.rgb(195,215,223);
//
//        BackgroundFill backgroundFill = new BackgroundFill(rgb, null, null);
//        Background background = new Background(backgroundFill);
//        pane.setBackground(background);
    }


    /**
     * 标签样式
     * @param pane 标签
     */
    public static void labelStyle(Pane pane) {

        pane.setBackground(new Background(//背景色
                new BackgroundFill(Color.rgb(218, 218, 218),
                        null, null)));

        pane.setBorder(//边框
                new Border(new BorderStroke(null, null, Color.rgb(153, 153, 153), null,
                        null, null, BorderStrokeStyle.DOTTED, null, null, null, null)
                ));

    }
}
